]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-texture-cache: Set sliced actor size in logical size
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 25 Feb 2019 20:26:46 +0000 (21:26 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 1 Mar 2019 17:12:53 +0000 (17:12 +0000)
The actor size should be set in logical size more than in the actual size
of the texture when using resource scale.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5

src/st/st-texture-cache.c

index 40213077063017c09f959d94161d747cd76fb411..b84f3ffdcf9e1cd0a4c31a9da43af80e23349176 100644 (file)
@@ -1008,14 +1008,16 @@ st_texture_cache_load_gicon (StTextureCache    *cache,
 }
 
 static ClutterActor *
-load_from_pixbuf (GdkPixbuf *pixbuf)
+load_from_pixbuf (GdkPixbuf *pixbuf,
+                  int        paint_scale,
+                  float      resource_scale)
 {
   g_autoptr(ClutterContent) image = NULL;
   ClutterActor *actor;
   int width = gdk_pixbuf_get_width (pixbuf);
   int height = gdk_pixbuf_get_height (pixbuf);
 
-  image = pixbuf_to_st_content_image (pixbuf, width, height, 1, 1.0f);
+  image = pixbuf_to_st_content_image (pixbuf, -1, -1, paint_scale, resource_scale);
 
   actor = clutter_actor_new ();
   clutter_actor_set_size (actor, width, height);
@@ -1109,7 +1111,9 @@ on_sliced_image_loaded (GObject *source_object,
 
   for (list = pixbufs; list; list = list->next)
     {
-      ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data));
+      ClutterActor *actor = load_from_pixbuf (GDK_PIXBUF (list->data),
+                                              data->paint_scale,
+                                              data->resource_scale);
       clutter_actor_hide (actor);
       clutter_actor_add_child (data->actor, actor);
     }